<template>
	<view class="select-reservation">
		<view class="work-day">工作日预约</view>
		<view class="work-list">
			<view v-for="item in serviceHallArr" :key="item.id">
				<view class="list"  v-if="item.is_convenience === 0" @click="handleReservation(item)">{{item.name}}</view>
			</view>
		</view>
		<view class="work-day">便民服务日预约</view>
		<view class="work-list">
			<view v-for="item in serviceHallArr" :key="item.id">
				<view class="list"  v-if="item.is_convenience === 1" @click="handleReservation(item)">{{item.name}}</view>
			</view>
		</view>
	</view>
</template>

<script>
	import { serviceHall } from '../utils/methods.js'
	export default {
		onShareAppMessage(res) {
			return {
			  title: '石家庄不动产中心',
			  path: '/pages/index'
			}
		},
		onLoad(data) {
			this.business = JSON.parse(data.business)
		},
		data() {
			return {
				business: {},
				serviceHallArr: [],
				
			};
		},
		methods: {
			handleReservation(item) {
				uni.navigateTo({url: `/pages/reservation?hall=${JSON.stringify(item)}&business=${JSON.stringify(this.business)}`})
			},
		},
		mounted() {
			serviceHall(this.business.id).then(res => {
				if(res.data.code == 0) {
					this.serviceHallArr = res.data.data
				}
			})
		}
	}
</script>

<style lang="less">
.select-reservation {
	padding: 10px 10rpx;
	box-sizing: border-box;
	.work-day {
		border-left: 10rpx solid #0c45bd;
		color: #0c45bd;
		padding: 20rpx;
		font-size: 40rpx;
		font-weight: 600;
		margin-bottom: 20rpx;
	}
	.work-list {
		padding: 0px 30rpx;
		.list {
			border: 2px solid #f3f3f3;
			padding: 30rpx;
			border-radius: 10rpx;
			text-align: center;
			font-size: 40rpx;
			margin-bottom: 40rpx
		}
	}
}
</style>
